<script setup>
// 1. parent ==> son(variable)
// irst way
// defineProps(['msg'])

// second way
defineProps({
  msg: {
    type: String,
    required: true,
  },
})

// 2. son ==> parent(custom-event)
const emit = defineEmits(['sendExample'])
const sendMsg = () => {
  emit('sendExample', 'send one message from component01')
}
</script>

<template>
  <div class="component01">
    component01
    <p>{{ msg }}</p>
    <button @click="sendMsg">sendBtn</button>
  </div>
</template>

<style scoped>
.component01 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  width: 300px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #f8f9fa;
  color: rgb(0, 191, 255);
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  position: relative;
  overflow: hidden;
}
</style>
